<%@ page language="Java" import="java.util.*,descriptor.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%
	
	OfferListDescriptor offerList = (OfferListDescriptor)request.getAttribute("offerList");
	RecruiterDescriptor recruiter = (RecruiterDescriptor)request.getAttribute("recruiter");
	if(recruiter == null){
		response.sendRedirect("index.jsp");
	}

%>
<html>
	<jsp:include page="recruiterHeader.jsp" >
		<jsp:param name="pageTitle" value="Work Placement Management System - Recruiter" />
	</jsp:include>
	<body OnLoad="showmenu(document.getElementById('smenu2'));">
		<jsp:include page="recruiterPageHeader.jsp"></jsp:include>
		<div id="container">
			<jsp:include page="recruiterMenu.jsp" ></jsp:include>
			<div id="content">
			<h3 class="posttitle">You have <%=offerList.getOfferList().size()%> Offer(s)</h3>
				<div class="entry">
				
				

<table cellpadding="0" cellspacing="10" border="0">
<tr>
<td>Name</td><td>Offer</td><td>Type</td><td>Status</td>
</tr>

<%
for(OfferDescriptor offer: offerList.getOfferList()){
%>
<tr>
<td><%=offer.getName()%> </td><td><a href="RecruiterServlet?page=recruiterViewAnOffer&amp;offerId=<%=offer.getId()%>">view the offer</a>/<a href="RecruiterServlet?page=recruiterRemoveOffer&amp;offerId=<%=offer.getId()%>">Remove the offer</a></td><td>
<%if(offer.getType()==0){
%>private
<%}else{
%>
public
<%
}
%>

</td>
<td>
<% if(offer.getStatus() == 2){
%>
Accepted
<%
}else if (offer.getStatus() == 3){
%>
Rejected
<%
}else if (offer.getStatus() == 4){
%>
Publish
<%
}else if (offer.getStatus() == 5){
%>
Waiting for status after interview <a href="RecruiterServlet?page=recruiterConfirmeOffer&amp;offerId=<%=offer.getId()%>">Accept</a>/<a href="RecruiterServlet?page=recruiterRejectOffer&amp;offerId=<%=offer.getId()%>">Reject</a> 
<%
}else if (offer.getStatus() == 6){
%>
Waiting for student acceptation
<%
}else if (offer.getStatus() == 7){
%>
Rejected by you after interview 
<%
}else if (offer.getStatus() == 8){
%>
Accepted by you and the student!
<%
}
%>
</td>
</tr>
<%
}
%>
</table>



				</div>
	    	</div>
			<jsp:include page="recruiterPageFooter.jsp"></jsp:include>
		</div>
	</body>
</html>